<?
$locationType = getDefault($this->game->zoneStats[$this->selectedMapLocation.'.type'], 'text');
$locationText = $this->game->zoneStats[$this->selectedMapLocation.'.text'];
if (stristr($locationText, ':') != '')
  $locationTitle = CutSegment(':', $locationText);
else
  $locationTitle = '';
$buttonText = $this->game->zoneStats[$this->selectedMapLocation.'.button'];

switch($locationType)
{
  case('action'):
  {
    $actionDS = DB_GetDataset('actions', $this->game->zoneStats[$this->selectedMapLocation.'.action']);
    $locationText = $actionDS['a_intro'];
    $locationTitle = $actionDS['a_name'];
    $buttonText = getDefault($buttonText, 'Attack!');
    $btnUrl = actionUrl('act', 'game', 'id='.$actionDS['a_key']);    
  }
  case('zone'):
  {
    if ($locationTitle != '') print('<h2 style="margin: 0px">'.$locationTitle.'</h2>');
    $btnUrl = getDefault($btnUrl, actionUrl('ajax_zone', 'map', 'id='.$this->selectedMapLocation));
    ?>
    <div style="padding-top: 3px"><?= $locationText ?></div>
    <div align="right" style="padding-top: 3px">
      <input type="button" id="zonebtn" value="<?= getDefault($buttonText, 'Move!') ?>"
        onclick="$('#zonebtn').fadeOut('normal'); document.location.replace('<?= $btnUrl ?>');"/>
    </div>
    <?
    break;
  }
  case('text'):
  default:
  {
    if ($locationTitle != '') print('<h2 style="margin: 0px">'.$locationTitle.'</h2>');
    ?><div><?= $locationText ?></div><?
    break;
  }
}

?>